package com.cn.qgx428.lazydiary.dialog

import android.app.Dialog
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.WindowManager
import android.widget.FrameLayout
import android.widget.LinearLayout
import android.widget.TextView
import com.cn.qgx428.lazydiary.R
import kotlinx.android.synthetic.main.dialog_loading.*


/**
 * Created by qinguanxiong on 2018/3/24.
 */
class LoadingDialog: Dialog {

    lateinit var mContext: Context
    lateinit var mainView: View

    constructor(context: Context?): super(context){
        mContext = context!!
        mainView = LayoutInflater.from(mContext).inflate(R.layout.dialog_loading, null)
        setContentView(mainView)
        val wm = mContext.getSystemService(Context.WINDOW_SERVICE) as WindowManager
        val display = wm.defaultDisplay
        loading_mainLayout.layoutParams =
                FrameLayout.LayoutParams(500,500)
    }

    public fun setText(msg: String){
        loading_txt.setText(msg)
    }
}